<%-- 
    Document   : candidatureCompany
    Created on : 27 nov. 2014, 20:54:54
    Author     : metbill
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<fieldset><legend> Applications  </legend></fieldset>
<c:if test="${empty applications}">
    <h3>No applications yet ! </h3>
</c:if>
<c:if test="${not empty applications}">   
    <c:forEach var="current" items="${applications}" >
        <!--
        <TABLE>
        <TR>
        <TD>
            <h3>Candidate: ${current.lastName} ${current.firstName}</h3> <br/>
            Mail: ${current.mail}<br/>

            <a href="${current.clPath}">CL</a><br/>
            <a href="${current.cvPath}">CV</a>
            <br/>
            Last Name: ${current.lastName}
            <br/>
            Status: ${current.status}
        </TD>
        <TD>-->
            <!--form class="navbar-form navbar-left" role="Interview" method="get" action="/WebApp/writeNotif/${current.applicationID}">
            <input type="hidden" name="internshipID" value="${current.internshipID}" />
            <input type="hidden" name="applicationID" value="${current.applicationID}" />
            <input type="submit" value="Interview" class="btn btn-primary"  >
            </form>
            <br-->
        <!--    <form class="navbar-form navbar-left" role="Accept" method="get" action="/WebApp/accept">
            <input type="hidden" name="internshipID" value="${current.internshipID}" />
            <input type="hidden" name="applicationID" value="${current.applicationID}" />
            <input type="submit" value="Accept" class="btn btn-primary"  >            
            </form>
            <br>
            <form class="navbar-form navbar-left" role="Refuse" method="get" action="/WebApp/refuse">
            <input type="hidden" name="internshipID" value="${current.internshipID}" />
            <input type="hidden" name="applicationID" value="${current.applicationID}" />
            <input type="submit" value="Refuse" class="btn btn-primary"  >            
            </form>
        </TD>
        </TR>    
        </TABLE>-->
            <h3>Candidate: ${current.lastName} ${current.firstName}</h3>
            <div class="form-group">
                <div class="row">
                    <!-- CV/CL-->
                    <div class="col-lg-4">
                        <span> <b><a href="${current.cvPath}">Link Curriculum Vitae</a></b></span>
                    </div>
                    <div class="col-lg-4">
                        <span> <b><a href="${current.clPath}">Link Cover Letter</a></b></span>
                    </div>
                </div>
                
                <br/>
                <c:set var="status" value="${current.status}"></c:set>
                <c:choose>
                    
                    <c:when test="${status >= 6}">
                        <div class="row">
                            <div class="col-lg-4">
                                <form class="navbar-form navbar-left" role="Interview" method="get" action="/WebApp/writeNotif/${current.applicationID}">
                                    <input type="hidden" name="internshipID" value="${current.internshipID}" />
                                    <input type="hidden" name="applicationID" value="${current.applicationID}" />
                                    <input type="submit" value="Interview" class="btn btn-primary"  >            
                                </form>
                            </div>           
                        </div>
                    </c:when>

                    <c:when test="${status == 3 || status ==4 || status ==5}">                    
                        <div class="row">
                                <h5 style=" color: red">The application was canceled. </h5>    
                        </div>
                        <div class="row">
                            <div class="col-lg-4">
                                <form class="navbar-form navbar-left" role="Mail" method="get" action="/WebApp/writeNotif/${current.applicationID}">
                                    <input type="hidden" name="internshipID" value="${current.internshipID}" />
                                    <input type="hidden" name="applicationID" value="${current.applicationID}" />
                                    <input type="submit" value="Mail" class="btn btn-primary"  >            
                                </form>
                            </div>           
                        </div>
                    </c:when>
                    
                    <c:otherwise>
                                        
                        <div class="row">
                            <!-- Accept/Refuse-->
                            <div class="col-lg-4">
                                <form class="navbar-form navbar-left" role="Accept" method="get" action="/WebApp/accept">
                                    <input type="hidden" name="internshipID" value="${current.internshipID}" />
                                    <input type="hidden" name="applicationID" value="${current.applicationID}" />
                                    <input type="submit" value="Accept" class="btn btn-primary"  >            
                                </form>
                            </div>
                            <div class="col-lg-4">
                                <form class="navbar-form navbar-left" role="Refuse" method="get" action="/WebApp/refuse">
                                    <input type="hidden" name="internshipID" value="${current.internshipID}" />
                                    <input type="hidden" name="applicationID" value="${current.applicationID}" />
                                    <input type="submit" value="Refuse" class="btn btn-primary"  >            
                                </form>
                            </div>
                        </div>
                    </c:otherwise>
                </c:choose>
                
            </div>

    </c:forEach>
</c:if>         